<template>
  <div class="list-item border-bottom" @click="checkDetail">
    <span class="icon">
      <icon-svg iconClass="iconnav_wap_goucai_y" v-show="dataType == '收入'"></icon-svg>
      <span class="placeholder" v-show="dataType !== '收入'"></span>
    </span>
    <div class="content">
      <div class="top">
        <span>{{item.accountName}}</span>
        <span>{{item.amount}}</span>
      </div>
      <div class="bottom">
        <span class="">{{item.type}}</span>
        <span>{{item.time | formater}}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
  props: {
    item: {
      type: Object,
      default: function() {
        return {}
      }
    },
    dataType: {
      type: String,
      default: ''
    }
  },
  methods: {
    checkDetail() {
      this.$emit('click', this.item.id)
    }
  },
  computed: {
    ...mapGetters(['getUserInfo'])
  }
}
</script>

<style lang="stylus" scoped>
  @import '~@/assets/styles/variables.styl'
  .list-item 
    display flex
    align-items center
    padding 16px 10px
    .icon 
      font-size 36px
      margin-right 10px
      .placeholder 
        display inline-block
        width 36px
        height 36px 
        border-radius: 50% 
        background $color-primary-green
    .content
      flex 1
      .top 
        display flex 
        justify-content space-between
        .red 
          color $color-theme-red 
        .green 
          color $color-primary-green
      .bottom 
        color $color-sub-grey 
        margin-top 5px
        display flex 
        justify-content space-between
</style>